package com.android.qjpmc.kernel;


import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
//import com.example.cy.monitorapp.DataShowActivity;
//import com.example.cy.monitorapp.JumpToEvent;

/**
 * Created by tree on 2016/8/22.
 */

public class MyReceiver extends BroadcastReceiver {

    public static final String TYPE = "type";

    //JumpToEvent JumpEvent;



    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        int type = intent.getIntExtra(TYPE, -1);

        if (type != -1) {
            NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
            notificationManager.cancel(type);
        }

        if (action.equals("notification_clicked")) {
            //处理点击事件
            //JumpEvent.ShowEvent();
        }

        if (action.equals("notification_cancelled")) {
            //处理滑动清除和点击删除事件
        }
    }
    /*
    public void SetJumpToEvent(JumpToEvent JumpEvent) {
        this.JumpEvent=JumpEvent;
    }
    */
}
